#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    button1=new QPushButton(this);
    button2=new QPushButton(this);
    button1->setGeometry(50,50,100,80);
    button2->setGeometry(50,200,100,80);
    button1->setText("按钮1");
    button2->setText("按钮2");
    //叠加性
    button1->setStyleSheet("QPushButton { font-size:30px; } ");
    //局部优先原则
    button2->setStyleSheet("QPushButton { color:green; } ");
}

Widget::~Widget()
{
    delete ui;
}

